var logout=$("#logout");
logout.on("click",function(){
  var issure=confirm("您确认退出登录吗");
  if(issure){
    $.ajax({
      type:'post',
      url:'/logout',
      success:function(){
        location.href='login.html';
      },
      error:function(){
          alert("推出失败")
      }
    })
  }

});
$.ajax({
  type:"get",
  url:"/users/"+userId,
  success:function(res){
    $('.avatar').attr('src',res.avatar);
    $('.profile .name').html(res.nickName)
  }
})

function formateDate(date){
  var date=new Date(date);
  return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDay();
 }